package cn.daniel.goods.client;

import cn.daniel.commonutils.Response;
import cn.daniel.commonutils.result.ResultCode;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 定义远程调用的client失败之后执行的返回结果
 */
@Component
public class RemoteVideoCallClient implements VodClient {


    /**
     *定义远程模块方法的路径调用，根据视频id删除视频
     * @PathVariable 一定要指定参数名称，否则可能出错
     * @param id
     * @return Response
     */
    @DeleteMapping("/service/video/removeVideoById/{id}")
    public Response removeVideoById(@PathVariable("id") String id){
        return Response.error().message(ResultCode.DELETE_FILE_ERROR.getMessage());
    }

    /**
     * 定义远程模块方法的路径调用，删除多个视频
     * @param videoIdList  多个视频id
     * @return Response
     */
    @DeleteMapping("/service/video/deleteBatchVideo")
    public Response deleteBatchVideo(@RequestParam("videoIdList") List<String> videoIdList){
        return Response.error().message(ResultCode.DELETE_FILE_ERROR.getMessage());
    }

    @Override
    public Response getVideoInfo(String videoId) {
        return Response.error().message(ResultCode.ERROR.getMessage());
    }


}
